package com.wgts.wgts.dagger.module;

import com.wgts.wgts.dagger.scope.FragmentScope;
import com.wgts.wgts.mvp.model.IWgtsHomePageFragmentModel;
import com.wgts.wgts.mvp.model.imp.WgtsHomePageFragmentModel;
import com.wgts.wgts.mvp.presenter.IWgtsHomePageFragmentPresenter;
import com.wgts.wgts.mvp.presenter.imp.WgtsHomePageFragmentPresenter;
import com.wgts.wgts.mvp.view.IWgtsHomePageFragmentView;
import com.wgts.wgts.netmodle.NetService;

import dagger.Module;
import dagger.Provides;

@Module
public class WgtsHomePageFragmentModule {

    private IWgtsHomePageFragmentView view;

    public WgtsHomePageFragmentModule(IWgtsHomePageFragmentView view) {
        this.view = view;
    }

    @Provides
    @FragmentScope
    public IWgtsHomePageFragmentView provideView(){
        return view;
    }

    @Provides
    @FragmentScope
    public IWgtsHomePageFragmentModel provideModel(NetService netService){
        return new WgtsHomePageFragmentModel(netService);
    }

    @Provides
    @FragmentScope
    public IWgtsHomePageFragmentPresenter providePresenter(IWgtsHomePageFragmentModel model, IWgtsHomePageFragmentView view){
        return new WgtsHomePageFragmentPresenter(model, view);
    }
}
